{include file="public_head" /}

<!-- datatables -->
<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<!-- chk_3 -->
<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<body class="nav-md">

<div class="container body">


    <div class="main_container">

        {include file="public_sidebar,public_nav" /}

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>
                            预约服务
                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="row">

                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>预约服务</h2>
                                <!--<a style="float: right" href="{:url('create',['order_id' => input('order_id')])}"-->
                                <!--class="btn btn-success btn-sm">创建二级订单</a>-->
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="GET" action="">

                                    <div class="title_left">
                                        <div class="col-md-2 col-sm-3 col-xs-6 form-group pull-left top_search">
                                            <div class="input-group">
                                                <input id="test1" type="text" class="form-control" name="service_date"
                                                       placeholder="预约时间..." value="{:input('service_date')}">
                                            </div>
                                        </div>
                                        <!--<div class="col-md-2 col-sm-3 col-xs-6 form-group pull-left top_search">-->
                                            <!--<div class="input-group">-->
                                                <!--<input id="test12" type="text" class="form-control" name="title"-->
                                                       <!--placeholder="请输入内容..." value="{:input('title')}">-->
                                            <!--</div>-->
                                        <!--</div>-->
                                        <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索
                                        </button>
                                        {eq name='$auding_status' value="2"}
                                        <div class="input-group" style="float: left;">

                                            <select name="shop_id" id="status1" class="select2_single1" style="width: 200px;"
                                                    tabindex="-1">
                                                <option value="0">- 全部门店 -</option>
                                                {volist name=":db('shop')->select()" id="item"}
                                                <option value="{$item.id}" {eq name=':input("shop_id")' value='$item.id' }selected{/eq}>{$item.shop_title}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                        {/eq}
                                    </div>


                                    <table style="border-bottom:1px solid #ddd;"
                                           class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <!--<th style="width: 2%; padding: 10px;">-->
                                            <!--<input type="checkbox" class="checkall"-->
                                            <!--onclick="CheckAll(this.checked);"/>-->
                                            <!--</th>-->
                                            <!--<th>排序</th>-->
                                            <th>ID</th>
                                            <th>预约工位</th>
                                            <th>预约日期</th>
                                            <th>预约时间</th>
                                            <th>预约用户</th>

                                            <th>预约服务</th>
                                            <th>服务状态</th>
                                            <th>门店名称</th>

                                            <th>创建日期</th>
                                            <!--<th>预约时间状态(默认开启)</th>-->
                                            {eq name=":session('auding_status')" value="1"}
                                            <th>消息状态</th>
                                            {/eq}
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {empty name="data"}
                                        <tr>
                                            <!--<td colspan="5">-->
                                            <!--<div style='font-size:24px;margin:30px 0;'>没有找到记录</div>-->
                                            <!--</td>-->
                                        </tr>
                                        {/empty}

                                        {volist name="data" id="item"}

                                        {volist name="item.list" id="item2"}
                                        <tr>
                                            <td>{$item2.id}</td>
                                            <td>{$item2.title}</td>
                                            <td>{$item2.service_date}</td>
                                            <td>{$item2.service_time}</td>
                                            <td>{$item2.member.username}</td>
                                            <td>{$item2.single.cat_name}</td>
                                            <td>{$item2.statusa}</td>
                                            <td>{$item2.shop.shop_title}</td>
                                            <td>{$item2.create_time}</td>
                                            <!--<td>-->
                                                <!--<input type="checkbox" id="checkbox4_{$item2.id}" class="chk_3"-->
                                                       <!--value="{$item2.stop_order}" {eq name="item2['stop_order']" value="1"}checked{/eq} />-->
                                                <!--<label style="margin-left: 30px;margin-top: 5px;"-->
                                                       <!--onclick="CheckInfoa('{:url(\'status\',[\'id\' => $item2[\'id\']])}')"-->
                                                       <!--for="checkbox4_{$item2.id}"></label>-->
                                            <!--</td>-->
                                            {eq name=":session('auding_status')" value="1"}
                                            <td>
                                                {switch name="item2.is_read_shop"}
                                                {case 1}未读{/case}
                                                {case 2}已读{/case}
                                                {/switch}
                                            </td>
                                            {/eq}

                                            <td class="operate">

                                                <div>
                                                    <a href="{:url('update', ['id' => $item2['id'],'order_id' => input('order_id')])}"
                                                       class="label label-primary">
                                                        <span class="fa fa-pencil"></span>&nbsp;&nbsp;编 辑
                                                    </a>

                                                    <!--<a href="{:url('destroy', ['id' => $item['id']])}"-->
                                                    <!--class="label label-danger"-->
                                                    <!--onClick="return confirm('系统会自动删除类别下所有子类别，确定删除吗?')"-->
                                                    <!--&gt;-->
                                                    <!--<span class="fa fa-times"></span>&nbsp;&nbsp;删 除-->
                                                    <!--</a>-->
                                                </div>
                                            </td>
                                        {/volist}
                                        <tr>
                                            <td colspan="10" style="font-size: 16px;">{$item.service_date}</td>
                                        </tr>
                                        {/volist}
                                        </tbody>

                                    </table>
                                    <!-- 分页 -->
                                    <div style="float: right;margin-top: -30px;">{$data->render()}</div>
                                </form>
                            </div>
                        </div>
                        <button type="button" class="btn btn-success" style="margin-top: 20px;" onclick="dc()">预约服务</button>
                    </div>

                </div>
            </div>

        </div>
        <!-- /page content -->
    </div>

</div>
<script src="__STATIC__/js/select/select2.full.min.js"></script>
{include file="public_foot" /}
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>
<script>

    $(document).ready(function () {

        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        $(".select2_single1").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        $(".select2_single4").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        // interval_timer
        $('#interval_timer').daterangepicker(null,
            function(start, end, label) {
//                console.log(start.toISOString(), end.toISOString(), label);
            });
    });
    function CheckInfoa(stateUrl) {
        $.ajax({
            url: stateUrl,
            dataType: 'html',
            success: function (data) {
                if (data == 'false') {
                    layer.msg('更新状态失败');
                } else {
                    layer.msg('更新状态成功');
                }

            }
        });

        setTimeout(function () {
            history.go(0);
        },2000);


    }
    //导出excel表格
    function dc() {
        if (confirm('确认要导出订单?')) {
            var title = "{:input('title',0)}";
            window.location.href = "{:url('excel')}?title=" + title;
        }
    }
</script>
<script src="/laydate/laydate.js"></script> <!-- 改成你的路径 -->
<script>
    laydate.render({
        elem: '#test1'
    });
</script>
